/*
    Project Milestone 3
    by Lorenzo Miori [Lorenzo.Miori@stud-inf.unibz.it,
    Matteo Angriman [Matteo.Angriman@stud-inf.unibz.it],
    Nick Preda [Nicolae.Preda@stud-inf.unibz.it]
*/

package GUI;

import java.awt.Dimension;
import java.awt.Toolkit;

/**
 * This is the Main Menu of the Hotel Management System Client
 */
public class MainMenuGUI extends javax.swing.JFrame {

    public MainMenuGUI() {
        initComponents();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        setLocation((screenSize.width - getWidth()) / 2,
                (screenSize.height - getHeight()) / 2);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        exitButton = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        hotelsButton = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        extraServicesButton = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        addressButton = new javax.swing.JButton();
        transactionStateButton = new javax.swing.JButton();
        paymentMethodsButton = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        customersButton = new javax.swing.JButton();
        guestsButton = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        queryBookings = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        exitButton.setText("Exit");
        exitButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(291, Short.MAX_VALUE)
                .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(279, 279, 279))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(13, Short.MAX_VALUE)
                .addComponent(exitButton)
                .addContainerGap())
        );

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 310, 660, 50));

        jLabel1.setFont(new java.awt.Font("Dialog", 1, 24)); // NOI18N
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Hotel Management System");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 660, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        getContentPane().add(jPanel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 660, 50));

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Facilities"));
        jPanel3.setMinimumSize(new java.awt.Dimension(150, 50));
        jPanel3.setPreferredSize(new java.awt.Dimension(400, 200));
        jPanel3.setLayout(new java.awt.GridLayout(3, 4, 20, 20));

        hotelsButton.setText("Hotels");
        hotelsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                hotelsButtonActionPerformed(evt);
            }
        });
        jPanel3.add(hotelsButton);

        jButton5.setText("Rooms");
        jPanel3.add(jButton5);

        extraServicesButton.setText("Extra services");
        extraServicesButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                extraServicesButtonActionPerformed(evt);
            }
        });
        jPanel3.add(extraServicesButton);

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("General & Limits"));
        jPanel4.setLayout(new java.awt.GridLayout(4, 1, 20, 10));

        addressButton.setText("Addresses");
        addressButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addressButtonActionPerformed(evt);
            }
        });
        jPanel4.add(addressButton);

        transactionStateButton.setText("Transaction states");
        transactionStateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                transactionStateButtonActionPerformed(evt);
            }
        });
        jPanel4.add(transactionStateButton);

        paymentMethodsButton.setText("Payment methods");
        paymentMethodsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                paymentMethodsButtonActionPerformed(evt);
            }
        });
        jPanel4.add(paymentMethodsButton);

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("People"));
        jPanel6.setLayout(new java.awt.GridLayout(2, 1, 0, 15));

        customersButton.setText("Customers");
        customersButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                customersButtonActionPerformed(evt);
            }
        });
        jPanel6.add(customersButton);

        guestsButton.setText("Guests");
        guestsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                guestsButtonActionPerformed(evt);
            }
        });
        jPanel6.add(guestsButton);

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("Booking"));

        queryBookings.setText("Query bookings");
        queryBookings.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                queryBookingsActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(queryBookings, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(queryBookings)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(24, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(66, Short.MAX_VALUE))
        );

        getContentPane().add(jPanel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 50, 660, 260));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void addressButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addressButtonActionPerformed
        setEnabled(false);
        setVisible(false);
        new AddressListGUI(this);
    }//GEN-LAST:event_addressButtonActionPerformed

    private void hotelsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_hotelsButtonActionPerformed
        setEnabled(false);
        setVisible(false);
        new HotelListGUI(this);
    }//GEN-LAST:event_hotelsButtonActionPerformed

    private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed
        setEnabled(false);
        System.exit(0);
    }//GEN-LAST:event_exitButtonActionPerformed

    private void paymentMethodsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_paymentMethodsButtonActionPerformed
        setEnabled(false);
        setVisible(false);
        new ValidPaymentMethodsListGUI(this);
    }//GEN-LAST:event_paymentMethodsButtonActionPerformed

    private void transactionStateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_transactionStateButtonActionPerformed
        setEnabled(false);
        setVisible(false);
        new ValidTransactionStatesListGUI(this);
    }//GEN-LAST:event_transactionStateButtonActionPerformed

    private void extraServicesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_extraServicesButtonActionPerformed
        setEnabled(false);
        setVisible(false);
        new ExtraServicesListGUI(this);
    }//GEN-LAST:event_extraServicesButtonActionPerformed

    private void customersButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_customersButtonActionPerformed
        setEnabled(false);
        setVisible(false);
        new CustomerListGUI(this);
    }//GEN-LAST:event_customersButtonActionPerformed

    private void guestsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guestsButtonActionPerformed
        setEnabled(false);
        setVisible(false);
        new GuestListGUI(this);
    }//GEN-LAST:event_guestsButtonActionPerformed

    private void queryBookingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_queryBookingsActionPerformed
        setEnabled(false);
        setVisible(false);
        new GeneralBookingGUI(this);
    }//GEN-LAST:event_queryBookingsActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addressButton;
    private javax.swing.JButton customersButton;
    private javax.swing.JButton exitButton;
    private javax.swing.JButton extraServicesButton;
    private javax.swing.JButton guestsButton;
    private javax.swing.JButton hotelsButton;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JButton paymentMethodsButton;
    private javax.swing.JButton queryBookings;
    private javax.swing.JButton transactionStateButton;
    // End of variables declaration//GEN-END:variables
}
